import 'package:flutter/material.dart';
import 'package:qyou_app/common/base.dart';

class SearchBox with Base{

  Widget getSearchBox(){
    return Container(
      height: dp(35),
      margin: EdgeInsets.only(top: dp(10), bottom: dp(5), left: dp(10), right: dp(10)),
      padding: EdgeInsets.only(left: dp(10), right: dp(10)),
      decoration: BoxDecoration(
        color: Color(0xFFF5F5F5),
        borderRadius: BorderRadius.all(
          Radius.circular(dp(35 / 2)),
        ),
      ),
      child: Row(
        children: <Widget>[
          // 搜索ICON
          Image.asset(
            'assets/header/search.webp',
            width: dp(25),
            height: dp(15),
          ),
          // 搜索输入框
          Expanded(
            flex: 1,
            child: TextField(
              //controller: _search,
              cursorColor: Base.defaultColor,
              cursorWidth: 1.5,
              style: TextStyle(
                color: Base.defaultColor,
                fontSize: 14.0,
              ),
              decoration: InputDecoration(
                border: OutlineInputBorder(
                    borderSide: BorderSide.none
                ),
                contentPadding: EdgeInsets.all(0),
                hintText: '查找精彩动态内容',
                hintStyle: TextStyle(color: Color(0xFFBDBDBD))
              ),
            ),
          ),
        ],
      ),
    );
  }

}